package cn.itcast.com.network.udp.vv.onePerson;

import cn.itcast.com.network.udp.vv.ReceiveTask;
import cn.itcast.com.network.udp.vv.sendTask;

import java.net.DatagramSocket;
import java.net.SocketException;
import java.net.UnknownHostException;

public class OnePerson {
    public static void main(String[] args) throws SocketException, UnknownHostException {
        DatagramSocket datagramSocket = new DatagramSocket(8080);

        ReceiveTask receiveTask = new ReceiveTask(datagramSocket);
        String ip = "127.0.0.1";
        int port = 8282;
        sendTask sendTask = new sendTask(datagramSocket,ip,port);

        new Thread(sendTask).start();
        new Thread(receiveTask).start();
    }
}
